Skip to content

Instantly share code, notes, and snippets.

@SanCoder-Q
SanCoder-Q / synology.startup
Created December 25, 2017 14:29
Synology NAS - How to make a program run at startup
Synology NAS - How to make a program run at startup
The other day I created a little node.js project to keep track of some finances. Synology has a node.js package but that just installs the tools - it has no 'container' or any other support to drop files and have it run automagically. Maybe one day.
In the meantime, you can start your project when you SSH into the NAS. My project has a 'www' script which bootstraps my project, so to start I simply type 'node bin/www' from the project directory. But, it only runs while I'm logged in, and if I log out for any reason, the process dies. That's hardly useful when I'm away from home, or on a different PC. So I decided to have a look at starting my project as a Linux service.
After doing a lot of research into how Synology does services, and a few failed attempts at init scripts, I found that Synology DSM (since version 5 perhaps) bundles Upstart, which is a neat little tool to deal with services on Linux. It's most prevalent on Debian and derivatives (notably Ub
@xhliu
xhliu / escrow_zkp.js
Last active June 2, 2024 05:03
escrow w/ zkp
// require node 10 and Rust to run
// https://github.com/ZenGo-X/dlog-verifiable-enc
var ve = require('dlog-verifiable-enc').ve;
var assert = require('assert');
var { bsv, toHex, buildContractClass, Ripemd160, signTx, PubKey, Sig } = require('scryptlib');
const G = bsv.crypto.Point.getG()
const N = bsv.crypto.Point.getN()
const BN = bsv.crypto.BN
const { inputIndex, inputSatoshis, newTx, loadDesc } = require('./helper');
@danielchc
danielchc / docker-emby-bypass.md
Last active June 2, 2024 04:59
Emby Premiere: ByPass Docker container

Emby Premiere ByPass Docker container

❗ All the information provided on this tutorial are for educational purposes only. I'm not responsible for any misuse of this information. If you like the app buy it

Table of Contents

CC2652 unbricking with Raspberry Pi and OpenOCD

I was a bit quick when flashing my generic CC2652R and ended up dowloading and flashing firmware for CC2652P.. Since it was the wrong firmware, the bootloader also didn't work anymore, making me unable to flash the correct firmware with the integrated USB serial programmer.

Luckily the module has a cJTAG debugging interface, that should make it possible to flash directly onto the chip without the bootloader. But I don't have any serial debuggers, so I have had to come up withj my own from various limited information I could find.

Approach

Using OpenOCD we can use a Raspberry Pi as a JTAG debugger. It does not support cJTAG for debugging, so it will instead send a signal to make the CC2652 switch to normal JTAG. We will then have to connect a few additional cables to the TDO and TDI pins for a full 4-pin JTAG connection.

@jweinst1
jweinst1 / poll_tcp_server_client.c
Last active June 2, 2024 04:57
a polling and tcp based server and client in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <arpa/inet.h>
#include <netinet/in.h>
@wojteklu
wojteklu / clean_code.md
Last active June 2, 2024 05:05
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@jhaddix
jhaddix / reconftw.cfg
Last active June 2, 2024 04:53
reconFTW config file: NO google/osint, wordlist creation, nuclei js analysis
#################################################################
# reconFTW config file #
#################################################################
# General values
tools=~/Tools # Path installed tools
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" # Get current script's path
profile_shell=".$(basename $(echo $SHELL))rc" # Get current shell profile
reconftw_version=$(git rev-parse --abbrev-ref HEAD)-$(git describe --tags) # Fetch current reconftw version
generate_resolvers=false # Generate custom resolvers with dnsvalidator
@wenhuizhang
wenhuizhang / distributed_systems_readings.md
Last active June 2, 2024 04:53
distributed systems readings

#Distributed System Course List

##Systems

  • Cornell CS 614 - Advanced Course in Computer Systems - Ken Birman teaches this course. The readings cover more distributed systems research than is typical (which I am in favour of!). In fact, there's barely anything on traditional internal OS topics like filesystems or memory management. There's some worthwhile commentary at the bottom of the page.

  • Princeton COS 518 - Advanced Operating Systems - short and snappy reading list of two papers per topic, covering some interesting stuff like buffering inside the operating system, and L4.

@roandevs
roandevs / mediafire.js
Created November 25, 2022 13:26
A JS written class to interact with MediaFire's API. Supports login via email & pass, fetching folder content, uploading & updating single and multi chunk files.
const axios = require('axios');
const qs = require('qs');
const FormData = require('form-data');
const fs = require('fs');
const hasha = require('hasha');
const chunkingStreams = require('chunking-streams');
const SizeChunker = chunkingStreams.SizeChunker;
const DEBUG = false;
@natyusha
natyusha / Naty's FFXIV Endwalker Add-ons, Plugins and Mods.md
Last active June 2, 2024 04:52
All the third party add-ons, plugins and mods I use for FFXIV.

Last Updated: Patch 6.58

The program which most people use for parsing in FFXIV and several other MMOs. For an open source alternative consider using IINACT though configuring it won't be covered here.

Options

  • Main Table Encounters
    • General
      • Uncheck: Number of seconds to wait after the last combat action to begin a new encounter.
      • Uncheck: Number of seconds to wait after the last combat action to pause the encounter duration.

Plugins